<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0" name="viewport">
	<title>拍照上传</title>
	<link rel="stylesheet" href="">
	<style>
		img#blah{
			background-size: cover;
			width: 100%;
			height: auto; 
		}
	</style>
	<script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script>
</head>
<body>
<form id="form1" runat="server">
<!-- <input type='file' id="imgInp" /> -->
<input type="file" accept="image/*" capture="camera"  id="imgInp">
<div>
<img id="blah" src="#" width="" height="" alt="显示您上传的商品图片" />	
</div>

 
</form>

<script type="text/javascript">
	<!-- https://cdn.bootcss.com/jquery/1.12.4/ -->
	function readURL(input) {
	   if (input.files && input.files[0]) {
	       var reader = new FileReader();
	       reader.onload = function (e) {
	       	   console.log('e',e)
	           $('#blah').attr('src', e.target.result);
	       }
	       reader.readAsDataURL(input.files[0]);
	   }
	}
	$("#imgInp").change(function(){
	   readURL(this);
	});
</script>


</body>
</html>